package com.xxxx.seckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xxxx.seckill.VO.GoodsVO;
import com.xxxx.seckill.VO.OrderDetailVO;
import com.xxxx.seckill.pojo.Order;
import com.xxxx.seckill.pojo.User;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author Jack
 * @since 2024-04-06
 */
public interface IOrderService extends IService<Order> {

    /**
     * 功能描述：秒杀下单
     *
     * @param user  :
     * @param goods :
     * @return :
     */
    Order seckill(User user, GoodsVO goods);

    /**
     * 功能描述：订单详情
     *
     * @param orderId:
     * @return :
     */
    OrderDetailVO detail(Long orderId);

    /**
     * 功能描述：获取秒杀地址
     *
     * @param user    :
     * @param goodsId :
     * @return :
     */
    String createSeckillPathFragment(User user, Long goodsId);

    /**
     * 功能描述：校验秒杀地址
     *
     * @param user    :
     * @param goodsId :
     * @return :
     */
    boolean checkFragment(User user, Long goodsId, String fragment);

    /**
     * 功能描述：校验验证码
     *
     * @param user    :
     * @param goodsId :
     * @param captcha :
     * @return :
     */
    boolean checkCaptcha(User user, Long goodsId, String captcha);
}
